module.exports = {
  presets: ['@vue/cli-plugin-babel/preset'],
  plugins: [
    [
      'import',
      {
        libraryName: '@web-utils/component',
        style(name) {
          const path = `${name}/style.css`
          try {
            require.resolve(path)
            return path
          } catch (e) {
            // 解析不到样式
          }
          return false
        },
        customName(name) {
          return `@web-utils/component/${name}`
        }
      },
      '@web-utils/component'
    ],
    [
      'import',
      {
        libraryName: 'element-ui',
        libraryDirectory: 'lib'
      },
      'element-ui'
    ]
  ]
}
